package com.xiaoKe.zhonghzu.global.view;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.xiaoKe.zhonghzu.R;

/**
 * @ProjectName : app
 * @Author : Shijingna
 * @Time : 2023/11/22 11:15 上午
 * @Description : 文件描述
 */
public class ViewTotHeader extends RelativeLayout {
    public ViewTotHeader(Context context) {
        super(context);
    }

    public ViewTotHeader(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public ViewTotHeader(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    public TextView modeName,tvRight;
    public LinearLayout linerRight;
    public ImageView rightImg;

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();
        modeName = findViewById(R.id.modeName);
        tvRight = findViewById(R.id.tvRight);
        linerRight = findViewById(R.id.linerRight);
        rightImg = findViewById(R.id.rightImg);

    }
    public void into(int name,int tvRightStr,boolean aBoolean) {
        modeName.setText(name);
        if (tvRightStr!=0){
            tvRight.setText(tvRightStr);
        }
        linerRight.setVisibility(aBoolean?VISIBLE:GONE);
        rightImg.setVisibility(aBoolean?VISIBLE:GONE);
    }
    public void into(String name,int tvRightStr,boolean aBoolean) {
        modeName.setText(name);
        if (tvRightStr!=0){
            tvRight.setText(tvRightStr);
        }
        linerRight.setVisibility(aBoolean?VISIBLE:GONE);
    }
    /**
     * @param name
     * @param aBoolean
     */
    public void into(String name ,boolean aBoolean) {
        modeName.setText(name);
        linerRight.setVisibility(aBoolean?VISIBLE:GONE);
    }
}
